Many electronic devices support gesture recognition. In a current gesture recognition system, when the gesture recognition system of a electronic device establishes a detection block to detect and recognize a gesture of a hand, the established detection block may comprise one or more other objects (wall, human head, etc.). If such objects are not filtered from the detection block, the recognition precision of the gesture recognition system can be affected.